loading screen unity

99

loading screen unity -

IEnumerator load(){
    yield return null;

    //Begin to load the Scene you specify
    AsyncOperation asyncOperation = SceneManager.LoadSceneAsync(sceneIndex);
    //Don't let the Scene activate until you allow it to
    asyncOperation.allowSceneActivation = false;
    Debug.Log("Pro :" + asyncOperation.progress);
    //When the load is still in progress, output the Text and progress bar
    while (!asyncOperation.isDone)
    {
        //Output the current progress
        Debug.Log("Loading progress: " + (asyncOperation.progress * 100) + "%");

        // Check if the load has finished
        if (asyncOperation.progress >= 0.9f)
        {
            //Change the Text to show the Scene is ready
            asyncOperation.allowSceneActivation = true;
        }

        yield return null;
    }
}

Comments

Submit
0 Comments